﻿<%@ Control Language="C#" AutoEventWireup="true" Codebehind="PortalManagement.ascx.cs"
    Inherits="Framework.Portal.Administrator.Portals.PortalManagement" %>
<%@ Register Assembly="Framework.WebControl" Namespace="Framework.WebControls" TagPrefix="cc3" %>
<%@ Register Assembly="Framework.Module.MultiLanguage" Namespace="Framework.Module.MultiLanguage.WebControls"
    TagPrefix="cc2" %>
<%@ Register Assembly="Framework.FilePickerControl" Namespace="Framework.FilePicker"
    TagPrefix="cc1" %>
<%@ Register Assembly="System.Web.Extensions" Namespace="System.Web.UI" TagPrefix="asp" %>
<table border="0" cellpadding="0" cellspacing="1" class="content" width="100%">
    <tr>
        <td class="postheader" width="60%" align="left" valign="top">
            <asp:UpdatePanel ID="upanelGridPortals" runat="server" UpdateMode="Conditional" RenderMode="Inline">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnUpdate" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="btnAdd" EventName="Click" />
                </Triggers>
                <ContentTemplate>
                    <table class="content" cellspacing="1" cellpadding="0" width="100%">                        
                        <tr>
                            <td class="header2" style="height: 19px" align="left">
                                Name</td>
                            <td class="header2" style="height: 19px" align="left">
                                Description</td> 
                            <td class="header2" style="height: 19px" width="80" align="left">
                                Action</td>                          
                        </tr>
                        <asp:Repeater ID="dgrPortals" runat="server" OnItemCommand="dgrPortals_ItemCommand">
                            <ItemTemplate>
                                <tr>
                                    <td class="post" align="left">
                                        <asp:LinkButton ID="NameEdit" runat="server" CommandName="editportal" CommandArgument='<%# Eval("PortalID") %>'
                                            Text='<%# Eval("Name") %>' /></td> 
                                    <td class="post" align="left">
                                        <%# Eval("Description")%></td>                                    
                                    <td class="post" align="left">
                                        <ImageButton:Update ID="btnEditPortal" ImageUrl="~/Administrator/Resource/Images/GridView/edit.png" runat="server" CommandArgument='<%# Eval("PortalID") %>' CommandName="editportal" ToolTip="Sửa" />
                                        &nbsp;                                        
                                        <ImageButton:Delete ID="btnDeletePortal" ImageUrl="~/Administrator/Resource/Images/GridView/delete.png" runat="server" CommandArgument='<%# Eval("PortalID") %>' CommandName="deleteportal" ToolTip="Xóa" />                                        
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater> 
                        <tr>
                            <td class="postfooter" colspan="3">
                                &nbsp;</td>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:UpdatePanel>
        </td>
        <td class="post" width="40%" align="left" valign="top">
            <asp:UpdatePanel ID="updatePanelAddPortal" runat="server" UpdateMode="Conditional" RenderMode="Inline">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="dgrPortals" EventName="ItemCommand" />
                </Triggers>
                <ContentTemplate>
                   <table width="100%" cellspacing="1" cellpadding="0" border="0" class="content">
                        <tr>
                            <td class="header1" align="left" colspan="2">
                                <asp:Label ID="lblCommandName" runat="server"></asp:Label>
                            </td>
                        </tr>
                        <tr>                            
                            <td colspan="2" class="header2" height="18">
                                <asp:Label id="lblUpdateStatus" runat="server" ForeColor="Blue" Font-Bold="True"></asp:Label>
                            </td>
                        </tr>                        
                        <tr>
                            <td class="postheader" width="30%" align="left">
                                <asp:Label ID="lblPortalID" runat="server" Text="PortalID" ></asp:Label></td>
                            <td class="post" width="70%" align="left">
                                <asp:TextBox ID="txtPortalID" runat="server" Enabled="False" Width="30px" ></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td class="postheader" width="30%" align="left">
                                <asp:Label ID="lblName" runat="server" Text="Name"></asp:Label></td>
                            <td class="post" width="70%" align="left">
                                <asp:TextBox ID="txtName" runat="server" Width="170px"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td class="postheader" width="30%" align="left">
                                <asp:Label ID="lblDescription" runat="server" Text="PortalID"></asp:Label></td>
                            <td class="post" width="70%" align="left">
                                <asp:TextBox ID="txtDescription" runat="server" Width="170px"></asp:TextBox></td>
                        </tr>                         
                        <tr>
                            <td class="postheader" width="30%" align="left">
                                <asp:Label ID="lblPortal" runat="server">Cổng cha</asp:Label></td>
                            <td class="post" width="70%" align="left">
                                <asp:DropDownList
                                    ID="dropPortal" runat="server" Width="170px" DataTextField="Portal_Name" DataValueField="PortalID" >
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="postheader" width="30%" align="left">
                                Ngôn ngữ</td>
                            <td class="post" width="70%" align="left">
                                <asp:DropDownList ID="drgLanguage" runat="server" DataTextField="Language_Name" DataValueField="ID"></asp:DropDownList></td>
                        </tr>
                        <tr>
                            <td class="postheader" width="30%" align="left">
                                <asp:Label ID="lblPicture" runat="server" Text="Ảnh" ></asp:Label></td>
                            <td class="post" width="70%" align="left">
                                <cc1:FilePicker ID="FilePicker1" runat="server" fpPopupURL="/FilePicker/TUFilePicker.aspx" fpUploadDir="/Administrator/images/" FileName="" fpAllowedUploadFileExts="" fpUploadSizeLimit="0"></cc1:FilePicker>
                            </td>
                        </tr>
                        <tr>
                            <td class="postheader" width="30%" align="left">
                                <asp:Label ID="lblVisible" runat="server" Text="Hiển thị" ></asp:Label></td>
                            <td class="post" width="70%" align="left">
                                <asp:CheckBox ID="chkVisible" runat="server" Checked="True" />
                            </td>
                        </tr>
                        <tr>
                            <td class="postheader" width="30%" align="left">
                                <asp:Label ID="lblActive" runat="server" Text="Kích hoạt" ></asp:Label></td>
                            <td class="post" width="70%" align="left">
                                <asp:CheckBox ID="chkEnable" runat="server" Checked="True" />
                            </td>
                        </tr>
                        <tr>
                            <td class="postheader" width="30%" align="left">
                                Thứ tự</td>
                            <td class="post" width="70%" align="left">
                                <asp:DropDownList ID="drgPriority" runat="server"></asp:DropDownList></td>
                        </tr>                        
                        <tr>
                            <td class="postfooter" colspan="2" valign="middle" align="center">
                                <cc3:ButtonRoleEdit ID="btnUpdate" runat="server" CssClass="pbutton" OnClick="btnUpdate_Click" Text="Cập nhật" />
                                    &nbsp;
                                <cc3:ButtonRoleAdd ID="btnAdd" runat="server" CssClass="pbutton" OnClick="btnAdd_Click" Text="Thêm mới" />&nbsp;                                    
                                <asp:Button ID="btnCancel" runat="server" CssClass="pbutton" Text="Huỷ" Width="60px" OnClick="btnCancel_Click" />
                            </td>
                        </tr>
                    </table>                
                </ContentTemplate>
            </asp:UpdatePanel>
        </td>
    </tr>
</table>
